// pages/xinjian/jilu/jilu.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
num:1,
sta:1,
list:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	this.dp()
  },
  dp() {
	  wx.getStorage({
	  	key:'uid',
	  	success: (e) => {
	  		wx.request({
	  			url: getApp().globalData.xc,
	  			method: "POST",
	  			header: {
	  				"Content-Type": "application/x-www-form-urlencoded"
	  			},
	  			data: {
	  				HTTP_API: 'vv/money/api/index/transaction',
	  				page:this.data.num,
	  				pagesize:20,
	  				token:e.data.uid,
	  				type:'chongzhi'
	  			},
	  			success:(e)=>{
	  				if(e.data.data.list.length<20){
	  					this.setData({
	  						sta:0
	  					})
	  				}
					let a=[]
	  				e.data.data.list.forEach(function(item,index){
						a.push(item)
	  					e.data.data.list[index].ctime=new Date(parseInt(item.ctime) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
	  				})
	  				console.log(e)
	  				this.setData({
	  					data:e.data.data,
	  					list:a
	  				})
	  			}
	  		})
	  	}
	  })
  },
  ovo() {
  	if (this.data.sta == 1) {
  		this.setData({
  			num: this.data.num + 1
  		})
  		this.dp()
  	}
  },
})